import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        token:'',
        user:{
            userId:'',
            userAccount: '',
            userName: '',
            userJob: 0,
        },
        term:0
    },
    mutations: {
        setUser: (state, obj) => {
            state.user=obj
        },
        setTerm: (state, terms) => {
            state.term = terms
        },
        setToken:(state,token) => {
            state.token=token
        }
    }
})
export default store
